package com.zhss.concurrency;

import java.util.concurrent.LinkedBlockingQueue;

/**
 * @ClassName LinkedBlockingQueueDemo
 * @Description TODO
 * @Author leejiliang
 * @DateTime 2021/7/16 14:59
 * @Version 1.0
 */
public class LinkedBlockingQueueDemo {
	public static void main(String[] args) throws InterruptedException {
		final LinkedBlockingQueue<String> blockingQueue = new LinkedBlockingQueue<>(10);
		System.out.println(blockingQueue.offer("1"));
		blockingQueue.offer("1");
		blockingQueue.offer("1");
		blockingQueue.offer("1");
		blockingQueue.offer("1");
		blockingQueue.offer("1");
		blockingQueue.offer("1");
		blockingQueue.offer("1");
		blockingQueue.offer("1");
		blockingQueue.offer("1");
		blockingQueue.offer("1");
		System.out.println(blockingQueue.offer("1"));
		blockingQueue.put("2");
		blockingQueue.add("3");


		blockingQueue.poll();
		blockingQueue.take();
		blockingQueue.peek();
	}
}
